//
//  SMUserManager.h
//  DiDi
//
//  Created by huangtie on 2017/3/18.
//  Copyright © 2017年 Sinmore. All rights reserved.
//

#import <Foundation/Foundation.h>
@interface SMUser : NSObject

@property (nonatomic , copy) NSString *nickname;
@property (nonatomic , copy) NSString *head_img;
@property (nonatomic , copy) NSString *phone;

@end

@interface SMUserManager : NSObject

@property (nonatomic , copy) NSString *token;

@property (nonatomic , strong) SMUser *userInfo;

+ (instancetype)shareManager;

// 是否登录
- (BOOL)isLogin;
// 检查是否登录（未登录会自动跳转登录页面）
- (BOOL)cheakLogin:(UIViewController *)targe
          callBack:(void (^)(NSString *token))callBack
       cancelBlock:(void (^)(void))cancelBlock;
// 跳转登录页
- (void)login:(UIViewController *)targe
     callBack:(void (^)(NSString *token))callBack
  cancelBlock:(void (^)(void))cancelBlock;

// 是否第一次启动APP
+ (BOOL)isFirstOpenApp;
// 设置APP非第一次启动
+ (void)rejectFirstOpenApp;

// 退出登录
- (void)logout:(void (^)(void))callBack;

// 刷新个人信息
- (void)reloadUserInformation:(void (^)(SMUser *info))callBack;

+ (void)saveTelString:(NSString *)tel;

+ (NSString *)loadTelString;

//获取某个手机号距离上次发送验证已经相隔多长时间。返回秒
+ (NSInteger)loadTimeDiffer;

+ (void)saveSendCodeTime;

+ (BOOL)isMobilePhoneNumber:(NSString *)mobileNum;
@end
